import Main from '@/components/main'

/**
 * iview-admin中meta除了原生参数外可配置的参数:
 * meta: {
 *  title: { String|Number|Function }
 *         显示在侧边栏、面包屑和标签栏的文字
 *         使用'{{ 多语言字段 }}'形式结合多语言使用，例子看多语言的路由配置;
 *         可以传入一个回调函数，参数是当前路由对象，例子看动态路由和带参路由
 *  hideInBread: (false) 设为true后此级路由将不会出现在面包屑中，示例看QQ群路由配置
 *  hideInMenu: (false) 设为true后在左侧菜单不会显示该页面选项
 *  notCache: (false) 设为true后页面在切换标签后不会缓存，如果需要缓存，无需设置这个字段，而且需要设置页面组件name属性和路由配置的name一致
 *  access: (null) 可访问该页面的权限数组，当前路由设置的权限会影响子路由
 *  icon: (-) 该页面在左侧菜单、面包屑和标签导航处显示的图标，如果是自定义图标，需要在图标名称前加下划线'_'
 *  beforeCloseName: (-) 设置该字段，则在关闭当前tab页时会去'@/router/before-close.js'里寻找该字段名对应的方法，作为关闭前的钩子函数
 * }
 */

export default [
  {
    path: '/login',
    name: 'login',
    meta: {
      title: 'Login - 登录',
      hideInMenu: true
    },
    component: () => import('@/views/login/Login')
  },
  {
    path: '/meter-manage',
    name: 'meter-manage',
    meta: {
      title: '表具管理',
      icon: 'navicon-round'
    },
    component: Main,
    children: [
      {
        path: 'query',
        name: 'MeterManageQuery',
        meta: {
          icon: 'table',
          title: '表具查询',
          notCache: false
        },
        component: () => import('@/views/meter-manage/query')
      },
      {
        path: 'distribution',
        name: 'distribution',
        meta: {
          icon: 'nuclear',
          title: '表具性能',
          notCache: true
        },
        component: () => import('@/views/meter-manage/distribution')
      },
      {
        path: 'cycle',
        name: 'cycle',
        meta: {
          icon: 'nuclear',
          title: '功耗优化',
          notCache: true
        },
        component: () => import('@/views/meter-manage/cycle')
      },
      {
        path: 'missingData',
        name: 'missingData',
        meta: {
          icon: 'nuclear',
          title: '缺失数据',
          notCache: true
        },
        component: () => import('@/views/meter-manage/missingData')
      },
      {
        path: 'matching',
        name: 'matching',
        meta: {
          icon: 'nuclear',
          title: '表具匹配',
          notCache: true
        },
        component: () => import('@/views/meter-manage/matching')
      }
    ]
  },
  {
    path: '/gas-survey',
    name: 'gas-survey',
    meta: {
      title: '气量概况',
      icon: 'navicon-round'
    },
    component: Main,
    children: [
      {
        path: 'query',
        name: 'GasSurveyQuery',
        meta: {
          icon: 'table',
          title: '气量查询',
          notCache: false
        },
        component: () => import('@/views/gas-survey/query')
      },
      {
        path: 'dailyview',
        name: 'dailyview',
        meta: {
          icon: 'table',
          title: '气量日览',
          notCache: true
        },
        component: () => import('@/views/gas-survey/dailyview')
      },
      {
        path: 'link-ratio',
        name: 'link-ratio',
        meta: {
          icon: 'table',
          title: '用气环比',
          notCache: true
        },
        component: () => import('@/views/gas-survey/link-ratio')
      },
      {
        path: 'link-ratio-week',
        name: 'link-ratio-week',
        meta: {
          icon: 'table',
          title: '周用气环比',
          notCache: true
        },
        component: () => import('@/views/gas-survey/link-ratio-week')
      },
      {
        path: 'link-ratio-month',
        name: 'link-ratio-month',
        meta: {
          icon: 'table',
          title: '月用气环比',
          notCache: true
        },
        component: () => import('@/views/gas-survey/link-ratio-month')
      }
    ]
  },
  {
    path: '/gas-forecast',
    name: 'gas-forecast',
    meta: {
      title: '气量预测',
      icon: 'navicon-round'
    },
    component: Main,
    children: [
      {
        path: 'single-table',
        name: 'single-table',
        meta: {
          icon: 'table',
          title: '单表预测',
          notCache: true
        },
        component: () => import('@/views/gas-forecast/single-table')
      }
    ]
  },
  {
    path: '/gas-law',
    name: 'gas-law',
    meta: {
      title: '气量分析',
      icon: 'navicon-round'
    },
    component: Main,
    children: [
      {
        path: 'tables-time',
        name: 'tables-time',
        meta: {
          icon: 'table',
          title: '个表小时用气规律',
          notCache: true
        },
        component: () => import('@/views/gas-law/tables-time')
      },
      {
        path: 'tables-day',
        name: 'tables-day',
        meta: {
          icon: 'table',
          title: '个表天用气规律',
          notCache: true
        },
        component: () => import('@/views/gas-law/tables-day')
      },
      {
        path: 'meter-reading-optimize',
        name: 'meter-reading-optimize',
        meta: {
          icon: 'table',
          title: '线下抄表效率优化',
          notCache: true
        },
        component: () => import('@/views/gas-law/meter-reading-optimize')
      }
    ]
  },
  {
    path: '/gas-monitoring',
    name: 'gas-monitoring',
    meta: {
      title: '气量监控',
      icon: 'navicon-round'
    },
    component: Main,
    children: [
      {
        path: 'history-verify',
        name: 'history-verify',
        meta: {
          icon: 'table',
          title: '历史数据审核',
          notCache: true
        },
        component: () => import('@/views/gas-monitoring/history-verify')
      },
      {
        path: 'negative-anomaly',
        name: 'negative-anomaly',
        meta: {
          icon: 'table',
          title: '负异常监控',
          notCache: true
        },
        component: () => import('@/views/gas-monitoring/negative-anomaly')
      },
      {
        path: 'leak-monitoring',
        name: 'LeakMonitoring',
        meta: {
          icon: 'table',
          title: '漏气监控',
          notCache: false
        },
        component: () => import('@/views/gas-monitoring/leak-monitoring')
      },
      {
        path: 'spare-gas',
        name: 'spare-gas',
        meta: {
          icon: 'table',
          title: '零用气量监控 ',
          notCache: true
        },
        component: () => import('@/views/gas-monitoring/spare-gas')
      },
      {
        path: 'small-gas',
        name: 'small-gas',
        meta: {
          icon: 'table',
          title: '微用气量监控 ',
          notCache: true
        },
        component: () => import('@/views/gas-monitoring/small-gas')
      },
      {
        path: 'micro-gas',
        name: 'micro-gas',
        meta: {
          icon: 'table',
          title: '微用气模式检查',
          notCache: true
        },
        component: () => import('@/views/gas-monitoring/micro-gas')
      }
    ]
  },
  {
    path: '/reports-build',
    name: 'reports-build',
    meta: {
      title: '报表定制',
      icon: 'navicon-round'
    },
    component: Main,
    children: [
      {
        path: 'meter-performs',
        name: 'meter-performs',
        meta: {
          icon: 'table',
          title: '表具性能',
          notCache: true
        },
        component: () => import('@/views/reports-build/meter-performs')
      },
      {
        path: 'power-optimization',
        name: 'power-optimization',
        meta: {
          icon: 'table',
          title: '功耗优化',
          notCache: true
        },
        component: () => import('@/views/reports-build/power-optimization')
      },
      {
        path: 'missing-data',
        name: 'missing-data',
        meta: {
          icon: 'table',
          title: '数据缺失',
          notCache: true
        },
        component: () => import('@/views/reports-build/missing-data')
      },
      {
        path: 'meter-matching',
        name: 'meter-matching',
        meta: {
          icon: 'table',
          title: '表具匹配',
          notCache: true
        },
        component: () => import('@/views/reports-build/meter-matching')
      },
      {
        path: 'template-custom',
        name: 'TemplateCustom',
        meta: {
          icon: 'table',
          title: '模板定制',
          notCache: false
        },
        component: () => import('@/views/reports-build/template-custom')
      },
      {
        path: 'template-detail',
        name: 'template-detail',
        meta: {
          icon: 'table',
          title: '模板表格',
          notCache: true
        },
        component: () => import('@/views/reports-build/template-detail')
      },
      {
        path: 'custom-page',
        name: 'CustomPage',
        meta: {
          icon: 'table',
          title: '页面定制',
          notCache: false
        },
        component: () => import('@/views/reports-build/custom-page')
      }
    ]
  },
  {
    path: '/sys-setting',
    component: Main,
    meta: {
      hideInMenu: true
    },
    children: [
      {
        path: '/',
        name: 'SysSetting',
        meta: {
          hideInMenu: true,
          icon: 'ios-setting',
          title: '系统设置',
          notCache: false
        },
        component: () => import('@/views/sys-setting')
      }
    ]
  },
  {
    path: '/pipe-network',
    meta: {
      title: '管网仿真',
      icon: 'navicon-round'
    },
    component: Main,
    children: [
      {
        path: 'modeling',
        name: 'Modeling',
        meta: {
          icon: 'table',
          title: '管网建模',
          notCache: true
        },
        component: () => import('@/views/pipe-network/modeling')
      },
      {
        path: 'ability-analysis',
        name: 'AbilityAnalysis',
        meta: {
          icon: 'table',
          title: '管网能力分析',
          notCache: true
        },
        component: () => import('@/views/pipe-network/abilityAnalysis')
      },
      {
        path: 'tuning',
        name: 'Tuning',
        meta: {
          icon: 'table',
          title: '管网调优',
          notCache: true
        },
        component: () => import('@/views/pipe-network/tuning')
      },
      {
        path: 'monitor',
        name: 'Monitor',
        meta: {
          icon: 'table',
          title: '管网监控',
          notCache: true
        },
        component: () => import('@/views/pipe-network/monitor')
      }
    ]
  },
  {
    path: '/401',
    name: 'error_401',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/views/error-page/401')
  },
  {
    path: '/500',
    name: 'error_500',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/views/error-page/500')
  },
  {
    path: '/',
    redirect: '/home',
    component: Main,
    children: [
      {
        path: '/home',
        name: 'Home',
        meta: {
          hideInMenu: true,
          title: '首页',
          notCache: false,
          icon: 'home'
        },
        component: () => import('@/views/home')
      }
    ]
  },
  {
    path: '*',
    name: 'error_404',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/views/error-page/404')
  }
]
